package com.ryan.mms.privilage.model;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;

import com.ryan.framework.model.Model;

/**
 * Operator entity.
 * 
 * @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "operator")
public class Operator implements Model{

	private static final long serialVersionUID = 1L;

	// Fields
	@GenericGenerator(name = "generator", strategy = "increment")
	@Id
	@GeneratedValue(generator = "generator")
	@Column(name = "operator_id", unique = true, nullable = false)
	private Long operatorId;
	
	@ManyToOne( cascade = {CascadeType.PERSIST}, targetEntity=Member.class )
	@JoinColumn(name="member_id")
	private Member member;
	
	@Column(name = "login_name", nullable = false, length = 64)
	private String loginName;

	@Column(name = "password", nullable = false, length = 100)
	private String password;

	@Column(name = "status", nullable = false)
	private Integer status;

	// Constructors

	/** default constructor */
	public Operator() {
	}

	/** full constructor */
	public Operator(String loginName, String password, Member member,
			Integer status) {
		this.member = member;
		this.loginName = loginName;
		this.password = password;
		this.status = status;
	}

	public Long getOperatorId() {
		return this.operatorId;
	}

	public void setOperatorId(Long operatorId) {
		this.operatorId = operatorId;
	}
	
	public Member getMember() {
		return member;
	}

	public void setMember(Member member) {
		this.member = member;
	}

	public String getLoginName() {
		return this.loginName;
	}

	public void setLoginName(String loginName) {
		this.loginName = loginName;
	}

	public String getPassword() {
		return this.password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public Integer getStatus() {
		return this.status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}

}